package com.zsw.customer2c.service;

import com.zsw.customer2c.service.impl.testServiceFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 使用feign 微服务之间的通信
 * 这里value的name对应调用服务的spring.applicatoin.name
 */
@FeignClient(value = "serviceproducer1",fallback = testServiceFallback.class)
public interface testService {
        @RequestMapping(value = "/hi/{id}")
        String hi(@PathVariable String id);


        @GetMapping(value = "/client")
        String test();

        @GetMapping(value = "/fallback")
        String expectFallback();

}
